<template>
  <van-picker
    show-toolbar
    :columns="columns"
    @confirm="onConfirmHousehold"
    @cancel="$emit('close')"
    confirm-button-text="确定"
    class="picker"
  />
</template>

<script>
export default {
  name: 'Picker',
  props: {
    columns: {
      type: Array,
      required: true
    }
  },
  methods: {
    onConfirmHousehold(value) {
      this.$emit('close')
      this.$emit('confirm', value)
    }
  }
}
</script>

<style scoped lang="less">
.picker {
  .van-picker__toolbar {
    height: 42px;
    .van-picker__cancel,
    .van-picker__confirm {
      padding: 9px 15px;
      color: #108ee9;
      font-size: 17px;
    }
  }
  .van-picker__columns {
    height: 238px !important;
    line-height: 1;
    .van-picker-column {
      margin-top: -10px;
    }
  }
}
</style>
